package com.orange.cetback.controller.user;

import com.orange.cetback.common.vo.Result;
import com.orange.cetback.pojo.dto.DictionaryDTO;
import com.orange.cetback.pojo.entity.Dictionary;
import com.orange.cetback.service.DictionaryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author chenenjun
 * @since 2025-04-07
 */
@Tag(name = "词典接口")
@Slf4j
@RestController
@RequestMapping("/userApi/dictionary")
public class DictionaryController {
    @Autowired
    private DictionaryService dictionaryService;

    @Operation(summary = "查询词典")
    @GetMapping("/query")
    public Result<Dictionary> query(DictionaryDTO dictionaryDTO){
        log.info("查询词典：{}",dictionaryDTO);
        Dictionary dictionary = dictionaryService.queryDictionary(dictionaryDTO);
        return Result.success(dictionary);
    }
}
